/*
 * Created on 18.04.2003
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package pho.prowon;

import java.util.Iterator;

/**
 * @author Peter
 *
 * This is the interface between the 'real' Image class that is used
 * by the GUI and the IndexImplementation which uses the default constructor 
 * plus the set and get Methods to inject the contained IPTC info-container...
 */
public interface ImageDataContainer
{
	/**
	 * Sets the ImageData object of the ImageDataContainer
	 * @param imd an ImageData object
	 */
	public void setImageData (ImageData imd);
	
	/**
	 * gets the ImageData object of the ImageDataContainer
	 * @return an ImageData object
	 */
	public ImageData getImageData ();

	/**
	 * saves the image including the IPTC information to the associated pathname
	 * if save was successful the hasChanged flag should be set to false using
	 * the setInitialized method of the imagedata (or otherwise when appropriate)
	 */
	public void save();		
	public void saveAs(String filename);
	public String getFileName();
	
	/**
	 * gets the ImageData tag as string
	 * @param tagName the name of the tag to be retrieved
	 * @return a string containing the tag's value (empty string if tag does not exist)
	 */
	public String getImageDataTag(String tagName);

	/**
	 * sets the ImageData tag's value
	 * @param tagName the name of the tag to be set
	 * @param value the new value (depending on the tag this has to adhere to the required format, e.g. Date, Time)
	 */
	public void setImageDataTag(String tagName, String value);	

	/**
	 * gets the ImageData tag as string array
	 * @param tagName the name of the tag to be retrieved
	 * @return a string containing the tag's value(s) as String array (Array with one empty string if tag does not exist)
	 */
	public String[] getImageDataTagArray(String tagName);

	/**
	 * sets the ImageData tag with the values in the string array - empty 
	 * strings in the array will be ignored during the set operation
	 * @param tagName the name of the tag to be set
	 * @param values the new values
	 */
	public void setImageDataTagArray(String tagName, String[] values);

	/**
	 * returns true if the Tag has more than one value associated (i.e. one value
	 * not equal to the empty string)
	 * @param idTag the name of the tag to be checked
	 * @return true if more than one value is set for this tag, false otherwise
	 */
	public boolean isImageDataTagArray (String idTag);
	
	/**
	 * returns true if the ImageData was successfully initialized. This is
	 * an indicator if the JPEG file that was used to initialize it was valid. It 
	 * does not tell whether there is IPTC information available on the image or not.
	 * If the ImageData was initialized without loading the file this is always true.
	 * @return false if an invalid JPEG File was found, true otherwise 
	 */
	public boolean isValid ();

	/**
	 * gets the pathname of the underlying JPEG file	 
	 * @return a string containing the full pathname
	 */
	public String getPathName();	

	/**
	 * gets an Iterator over all set tags (i.e. their names as string) 
	 * of this ImageData. This Iterator will not return any empty tags.
	 * @return an Iterator over Tag-Names (Strings)
	 */
	public Iterator getTagNameIterator();

	/**
	 * this indicates whether the image data information of the image has been
	 * modified since it's been loaded/saved the last time. This flag is set to
	 * false after initialization and should also be set to false after save has
	 * been carried out successfully.
	 * @return true if the image data has been modified
	 */
	public boolean hasChanged ();
}
